##!/bin/bash
##功能：导入车辆故障码表数据
# 使用 flink-cdc导入
##初始化环境变量
#source $(cd "$(dirname "$0")"; pwd)/../../initEnv.sh
#table_name=hy_fault_detail
#target_table_name=ods_hy_fault
#echo "导入${target_table_name}开始..."
#
#sqoop-import \
#  -D mapred.job.queue.name=hive \
#  --connect $HY_CONNECT \
#  --username $HY_USERNAME \
#  --password $HY_PASSWORD \
#  --query 'select
#           	spn,
#           	fmi,
#           	addr,
#           	fault_level
#           	from hy_fault_detail where DEL_FLAG = 0  or $CONDITIONS' \
#  --fields-terminated-by "\0001" \
#  --delete-target-dir \
#  --target-dir /user/root/mysql_tables/${table_name} \
#  --hive-import \
#  --hive-overwrite \
#  --hive-table ${target_table_name} \
#  --hive-database ${HIVE_DB} \
#  --hive-drop-import-delims \
#  --num-mappers 1 \
#  --as-parquetfile;
#
#if [ $? -ne 0 ] ; then
#  echo "导入ods_hy_fault失败，耗时$((`date +%s`-START_TIME))秒..."
#else
#  echo "导入ods_hy_fault成功，耗时$((`date +%s`-START_TIME))秒..."
#fi
